package com.ruoyi.utils;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

/**
 * @description: 将毫秒值转换为日期
 * @author: xukaihang
 * @date: 2025/9/18
 */
public class ConvertMillisecondValuesToDates {
    public static void main(String[] args) {
        long milliseconds = 1760342410282L;
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        ZoneId zoneId = ZoneId.systemDefault();
        String date = LocalDateTime.ofInstant(Instant.ofEpochMilli(milliseconds), zoneId).format(formatter);
        System.out.println(date);
    }
}
